<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="/WEB-INF/tld/core.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/orderStatus.tld" prefix="os" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<html>
<%@ include file="../common.jsp" %>
<script type="text/javascript" src="<%=basePath%>js/datePicker/WdatePicker.js" defer="defer" ></script>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" valign="top" background="images/mail_leftbg.gif"><img
				src="images/left-top-right.gif" width="17" height="29" /></td>
			<td valign="top" background="images/content-bg.gif"><div
					class="titlebt">改签信息</div></td>
			<td width="16" valign="top" background="images/mail_rightbg.gif"><img
				src="images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>
		<tr>
			<td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9"><br />
				<table class="mytable" cellpadding="0" cellspacing="0">
					<th colspan="3">订单信息</th>
					<tr>
						<td class="left"><label>订单号：</label>${vo.parentOrders[0].systemSn}</td>
						<td><label>用户编号:</label>${vo.parentOrders[0].memberNum}</td>
						<td><label>航程类型：</label> 
						 <s:if test="vo.parentOrders[0].voyagetype==1">单程</s:if>
						 <s:elseif test="vo.parentOrders[0].voyagetype==2">往返</s:elseif></td>
					</tr>
					<tr>
						<td class="left"><label>预订时间：</label>
						<s:date name="vo.parentOrders[0].bookTime"
								format="yyyy年MM月dd日 HH:mm:ss" />
						</td>
						<td colspan="3"><label>订单状态：</label>${vo.parentOrders[0].status}</td>
					</tr>
					<tr>
						<td class="left"><label>支付时间：<s:date
									name="vo.parentOrders[0].payTime" format="yyyy年MM月dd日 HH:mm:ss" />
						</label>
						</td>
						<td colspan="3"><label>订单总额：</label>
						<fmt:formatNumber value="${vo.parentOrders[0].orderTotal}"
								pattern="￥0.00"></fmt:formatNumber></td>
					</tr>
					<tr>
						<td class="left"><label>退款时间：</label>
						<s:date name="vo.parentOrders[0].refundTime"
								format="yyyy年MM月dd日 HH:mm:ss" />&nbsp;</td>
						<td colspan="3"><label>累计退款次数：</label>
							${vo.parentOrders[0].refundNum} 次</td>
					</tr>
				</table> <br /> <!-- 航程信息 -->
				<table class="mytable" cellpadding="0" cellspacing="0">
					<th colspan="10">航程信息</th>
					<tr style="font-size: 14px; font-weight: bolder">
						<td class="left">&nbsp;</td>
						<td>航班日期</td>
						<td>出发城市</td>
						<td>目的城市</td>
						<td>航班号</td>
						<td>舱位</td>
						<td>票面价</td>
						<td>机建费</td>
						<td>PNR编码</td>
						<td>状态</td>
					</tr>
					<s:iterator value="vo.childrenOrders" var="order">
						<tr>
							<td class="left"><s:if test="#order.traltype==1">去程</s:if> <s:elseif
									test="#order.traltype==2">返程</s:elseif>
							</td>
							<td><s:date name="sdate" format="yyyy年MM月dd日" /></td>
							<td>${order.scityCode}&nbsp;[<s:date name="depTime"
									format="HH:mm" />]</td>
							<td>${order.ecityCode}&nbsp;[<s:date name="arrTime"
									format="HH:mm" />]</td>
							<td>${order.flightNo}</td>
							<td>${order.cabinCode}</td>
							<td><fmt:formatNumber value="${order.fare}" pattern="￥0.00"></fmt:formatNumber>
							</td>
							<td><fmt:formatNumber value="${order.tax}" pattern="￥0.00"></fmt:formatNumber>
							</td>
							<td>${order.pnrno!=null?order.pnrno:'——'}</td>
							<td><os:apiJrOrder
									status="${order.orderStatus!=null?order.orderStatus:'-9'}"></os:apiJrOrder>
							</td>
						</tr>
					<tr>
  <td class="left">操作</td>
  <td colspan="9" align="center">
  <button class="Submit" onclick="JrCommit('hc','${order.id}')"><b>手动预订</b></button>
  <c:choose>
  	<c:when test="${vo.parentOrders[0].status!=0}">
  	
  		<c:if test="${order.orderStatus==null}">
				<button class="Submit" onclick="JrCommit('hc','${order.id}')"><b>手动预订</b></button>
			</c:if>
			<c:if test="${order.orderStatus==1}">
				<button class="Submit" onclick="JrCommit('hticket','${order.id}')"><b>手动出票</b></button>
			</c:if>
			<c:if test="${order.orderStatus==2}">
				<button class="Submit" onclick="JrCommit('ticketNotice','${order.id}')"><b>出票通知</b></button>
				<button class="Submit" onclick="GgCommit('${vo.parentOrders[0].id}','${vo.childrenOrders[0].id}')"><b>办理改签</b></button>
				<button class="Submit"><b>办理升舱</b></button>
			</c:if>
  	</c:when>
  	<c:otherwise>
  		用户未付款
  	</c:otherwise>
  </c:choose>
  </td></tr>
</s:iterator>
</table>
<!-- 航程信息  END-->
<br/>
<!-- 乘客信息-->
<table class="mytable" cellpadding="0" cellspacing="0">

	<c:choose>
		<c:when test="${vo.parentOrders[0].voyagetype==2}"><th colspan="7"></c:when>
		<c:otherwise><th colspan="5"></c:otherwise>
	</c:choose>
乘客信息</th>
	<tr style="font-size: 14px; font-weight: bolder">
		<td class="left">姓名</td><td>类型</td><td>证件号码</td><td>去程票号</td><td>去程状态</td>
		<c:if test="${vo.parentOrders[0].voyagetype==2}"><td>返程票号</td><td>返程状态</td></c:if>
	</tr>
	<s:iterator value="vo.orderPassengers" var="orderP">
	<tr>
		<td class="left">${orderP.passenger}</td>
		<td>${orderP.psgType==1?"成人":"儿童"}</td>
		<td><s:property value="orderP.cardNum"/></td>
		<td>${orderP.ticketNo!=null?item.ticketNo:'——'}</td>
		<td><s:property value="orderP.state"/></td>
		<c:if test="${vo.parentOrders[0].voyagetype==2}">
		<td>${orderP.secTicketNo!=null?orderP.secTicketNo:'——'}</td>
		<td><s:property value="orderP.secState"/>&nbsp;</td>
		</c:if>
	</tr>
</s:iterator>
</table>
<br/>
<table class="mytable" cellpadding="0" cellspacing="0">
	<tr><th colspan="2">联系人信息</th></tr>
	<tr style="font-size: 14px; font-weight: bolder"><td class="left">联系人</td><td>联系电话</td></tr>
	<tr><td class="left">${vo.parentOrders[0].linkname}</td><td>${vo.parentOrders[0].telphone}</td></tr>
</table>
<s:if test="vo.itinerary!=null">
<br/>
	<table class="mytable" cellpadding="0" cellspacing="0">
	<tr><th colspan="4">行程单配送信息</th></tr>
	<tr style="font-size: 14px; font-weight: bolder">
	<td class="left">联系人</td><td>邮编</td><td>寄件地址</td><td>状态</td></tr>
	<tr>
		<td class="left">${vo.itinerary.name}</td>
		<td>${vo.itinerary.zip}</td>
		<td>
			<s:if test="vo.itinerary.province==vo.itinerary.city">
				${vo.itinerary.city}
			</s:if>
			<s:else>
				${vo.itinerary.province}${vo.itinerary.city}
			</s:else>${vo.itinerary.address}
		</td>
		<td>
			<s:if test="vo.itinerary.status==0">未打印</s:if>
		</td>
	</tr>
</table>
</s:if>
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
<script type="text/javascript">
JrCommit = function(type,val){
	if(type=='hc'){
		$.ajax({
			url:'plane_create.shtml',
			data:'pid='+val,
			type:"post",
	        cache:false,
			success:function(data){
				location.reload();
			}
	        
		});
	}
	
}

GgCommit=function (pid,cid){
		$.ajax({
			url:'planeGaiqian_doUpdateOrder.shtml?',
			data:{'pid':pid,'cid':cid},
			type:'post',
			success:function(data){
				location.reload();
			}
		})
}
</script>
</body>
</html>